package com.fenghongzhang.day003_mvp.mvp.model;

import com.fenghongzhang.day003_mvp.mvp.contract.FoodContract;

import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.logging.HttpLoggingInterceptor;

/**
 * 操作数据层
 */
public class FoodModel implements FoodContract.IFoodModel {

    @Override
    public void getFoodData(Callback callback) {
        /**
         * 下载数据
         */
        OkHttpClient build = new OkHttpClient.Builder()
                .addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
                .build();


        Request build1 = new Request.Builder().get().url("http://www.qubaobei.com/ios/cf/dish_list.php?stage_id=1&limit=20&page=1").build();

        build.newCall(build1).enqueue(callback);
    }


    @Override
    public void destroy() {

    }
}
